package us.icitap.timsportal.entity;

import java.io.Serializable;

import javax.persistence.Column;
import javax.persistence.Embeddable;

@Embeddable
public class ModuleOrgPK implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -4815435727818791201L;

	@Column(name="ORG_ID")
	private Integer orgId;
	
	@Column(name="MODULE_ID")
	private Short moduleId;
	
	public ModuleOrgPK(){
		
	}
	
	public Integer getOrgId() {
		return orgId;
	}

	public void setOrgId(Integer orgId) {
		this.orgId = orgId;
	}

	public Short getModuleId() {
		return moduleId;
	}

	public void setModuleId(Short moduleId) {
		this.moduleId = moduleId;
	}

	@Override
	public int hashCode() {
		final int prime = 31;
		int result = 1;
		result = prime * result
				+ ((moduleId == null) ? 0 : moduleId.hashCode());
		result = prime * result + ((orgId == null) ? 0 : orgId.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj) {
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (!(obj instanceof ModuleOrgPK))
			return false;
		ModuleOrgPK other = (ModuleOrgPK) obj;
		if (moduleId == null) {
			if (other.moduleId != null)
				return false;
		} else if (!moduleId.equals(other.moduleId))
			return false;
		if (orgId == null) {
			if (other.orgId != null)
				return false;
		} else if (!orgId.equals(other.orgId))
			return false;
		return true;
	}

	@Override
	public String toString() {
		return "ModuleOrgPK [orgId=" + orgId + ", moduleId=" + moduleId + "]";
	}
}
